home *** CD-ROM | disk | FTP | other *** search
- u 14f l 24
- a 164
- ; Bug Fix for MSC 3.0 strncmp() Memory Model(s): S,M,L
- ;
- ; The following fix corrects a bug in the function strncmp() from
- ; the Microsoft C 3.0 Compiler Library.
- ; The original code would always search through memory (up to 65535
- ; bytes) until it found a zero byte, regardless of the length
- ; specified by the caller. This approach returns a correct value,
- ; but has nasty effects on performance when used to compare non-
- ; terminated strings.
- ; To apply this fix, extract strncmp.obj from slibc.lib (or
- ; mlibc or llibc) with:
- ; LIB slibc *strncmp;
- ; Then patch the object module and create a new library
- ; DEBUG strncmp.obj <msc3strn.pat
- ; Next, create a new object library to contain the fixed module
- ; LIB sfixlibc +strncmp;
- ; Finally, whereever LINK with slibc, use sfixlibc+slibc instead.
- ;
- ; Bug Reported to Microsoft 03/14/86.
- ;
- ; Frank McKenney, McKenney Associates
- ; Richmond, Virginia (804) 320-4887
- repnz
- scasb
- jcxz 170
- sub cx,bx
- neg cx
- jmp short 172
- nop
- nop
- mov cx,bx
-
- u 14f l 24
- w
- q
- Virginia (804) 320-4887
- repnz
- scasb
- j